home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / network.zip / SOURCE.ZIP / NETBIOS.H < prev    next >
Text File  |  1989-12-02  |  5KB  |  119 lines

  1.  
  2.     /* NETBIOS.H */
  3.  
  4. typedef unsigned char byte;
  5. typedef unsigned int  word;
  6.  
  7. /* Network Control Block (NCB)  */
  8.  
  9. typedef struct
  10.     {
  11.     byte NCB_COMMAND;               /* command id                         */
  12.     byte NCB_RETCODE;               /* immediate return code              */
  13.     byte NCB_LSN;                   /* local session number               */
  14.     byte NCB_NUM;                   /* network name number                */
  15.     void far *NCB_BUFFER_PTR;       /* address of message packet          */
  16.     word NCB_LENGTH;                /* length of message packet           */
  17.     byte NCB_CALLNAME[16];          /* name of the other computer         */
  18.     byte NCB_NAME[16];              /* our network name                   */
  19.     byte NCB_RTO;                   /* receive time-out in 500 ms. incrs. */
  20.     byte NCB_STO;                   /* send time-out - 500 ms. increments */
  21.     void interrupt (*POST_FUNC)(void); /* address of POST routine         */
  22.     byte NCB_LANA_NUM;              /* adapter number (0 or 1)            */
  23.     byte NCB_CMD_CPLT;              /* final return code                  */
  24.     byte NCB_RESERVE[14];           /* Reserved area                      */
  25.     } 
  26.     NCB;
  27.  
  28.  
  29. /* NetBIOS error return messages  */
  30.  
  31. char    *net_error_message[] = {
  32.         "success",                      /*  00  */
  33.         "invalid buffer length",        /*  01  */
  34.         "ret code 02",                  /*  02  */
  35.         "invalid command",              /*  03  */
  36.         "ret code 04",                  /*  04  */
  37.         "timed out",                    /*  05  */
  38.         "buffer too small",             /*  06  */
  39.         "ret code 07",                  /*  07  */
  40.         "invalid session num",          /*  08  */
  41.         "no resource",                  /*  09  */
  42.         "session closed",               /*  0A  */
  43.         "command cancelled",            /*  0B  */
  44.         "ret code 0C",                  /*  0C  */
  45.         "dupl. local name",             /*  0D  */
  46.         "name table full",              /*  0E  */
  47.         "active session",               /*  0F  */
  48.         "ret code 10",                  /*  10  */
  49.         "session table full",           /*  11  */
  50.         "no one listening",             /*  12  */
  51.         "invalid name num",             /*  13  */
  52.         "no answer",                    /*  14  */
  53.         "no local name",                /*  15  */
  54.         "name in use",                  /*  16  */
  55.         "name is deleted",              /*  17  */
  56.         "abnormal end",                 /*  18  */
  57.         "name conflict",                /*  19  */
  58.         "ret code 1A",                  /*  1A  */
  59.         "ret code 1B",                  /*  1B  */
  60.         "ret code 1C",                  /*  1C  */
  61.         "ret code 1D",                  /*  1D  */
  62.         "ret code 1E",                  /*  1E  */
  63.         "ret code 1F",                  /*  1F  */
  64.         "ret code 20",                  /*  20  */
  65.         "card busy",                    /*  21  */
  66.         "too many cmds",                /*  22  */
  67.         "invalid card num",             /*  23  */
  68.         "cancel done",                  /*  24  */
  69.         "ret code 25",                  /*  25  */
  70.         "cannot cancel"                 /*  26  */
  71.         };
  72.  
  73. /* Symbolic names for NetBIOS commands  */
  74.  
  75. #define RESET                           0x32
  76. #define CANCEL                          0x35
  77. #define STATUS                          0xb3
  78. #define STATUS_WAIT                     0x33
  79. #define TRACE                           0xf9
  80. #define TRACE_WAIT                      0x79
  81. #define UNLINK                          0x70
  82. #define ADD_NAME                        0xb0
  83. #define ADD_NAME_WAIT                   0x30
  84. #define ADD_GROUP_NAME                  0xb6
  85. #define ADD_GROUP_NAME_WAIT             0x36
  86. #define DELETE_NAME                     0xb1
  87. #define DELETE_NAME_WAIT                0x31
  88. #define CALL                            0x90
  89. #define CALL_WAIT                       0x10
  90. #define LISTEN                          0x91
  91. #define LISTEN_WAIT                     0x11
  92. #define HANG_UP                         0x92
  93. #define HANG_UP_WAIT                    0x12
  94. #define SEND                            0x94
  95. #define SEND_WAIT                       0x14
  96. #define SEND_NO_ACK                     0xf1
  97. #define SEND_NO_ACK_WAIT                0x71
  98. #define CHAIN_SEND                      0x97
  99. #define CHAIN_SEND_WAIT                 0x17
  100. #define CHAIN_SEND_NO_ACK               0xf2
  101. #define CHAIN_SEND_NO_ACK_WAIT          0x72
  102. #define RECEIVE                         0x95
  103. #define RECEIVE_WAIT                    0x15
  104. #define RECEIVE_ANY                     0x96
  105. #define RECEIVE_ANY_WAIT                0x16
  106. #define SESSION_STATUS                  0xb4
  107. #define SESSION_STATUS_WAIT             0x34
  108. #define SEND_DATAGRAM                   0xa0
  109. #define SEND_DATAGRAM_WAIT              0x20
  110. #define SEND_BCST_DATAGRAM              0xa2
  111. #define SEND_BCST_DATAGRAM_WAIT         0x22
  112. #define RECEIVE_DATAGRAM                0xa1
  113. #define RECEIVE_DATAGRAM_WAIT           0x21
  114. #define RECEIVE_BCST_DATAGRAM           0xa3
  115. #define RECEIVE_BCST_DATAGRAM_WAIT      0x23
  116.  
  117.  
  118.  
  119.